package org.xiaov.http;

/**
 * <p>
 * http协议的一些状态码
 * </p>
 *
 * @author: xiaovcloud
 * @date: 2021/2/1 14:29
 * @version：1.0
 */
public enum HttpCode {
    /**
     * Continue
     */
    HTTP_CONTINUE("Continue", 100),
    /**
     * OK
     */
    HTTP_OK("OK", 200),
    /**
     * Created
     */
    HTTP_CREATED("Created", 201),
    /**
     * Accepted
     */
    HTTP_ACCEPTED("Accepted", 202),
    /**
     * Non-Authoritative Information
     */
    HTTP_NOT_AUTHORITATIVE("Non-Authoritative Information", 203),
    /**
     * No Content
     */
    HTTP_NO_CONTENT("No Content", 204),
    /**
     * Reset Content
     */
    HTTP_RESET("Reset Content", 205),
    /**
     * Partial Content
     */
    HTTP_PARTIAL("Partial Content", 206),
    /**
     * Multiple Choices
     */
    HTTP_MULT_CHOICE("Multiple Choices", 300),
    /**
     * Moved Permanently
     */
    HTTP_MOVED_PERM("Moved Permanently", 301),
    /**
     * Temporary Redirect
     */
    HTTP_MOVED_TEMP("Temporary Redirect", 302),
    /**
     * See Other
     */
    HTTP_SEE_OTHER("See Other", 303),
    /**
     * Not Modified
     */
    HTTP_NOT_MODIFIED("Not Modified", 304),
    /**
     * Use Proxy
     */
    HTTP_USE_PROXY("Use Proxy", 305),
    /**
     * Bad Request
     */
    HTTP_BAD_REQUEST("Bad Request", 400),
    /**
     * Unauthorized
     */
    HTTP_UNAUTHORIZED("Unauthorized", 401),
    /**
     * Payment Required
     */
    HTTP_PAYMENT_REQUIRED("Payment Required", 402),
    /**
     * Forbidden
     */
    HTTP_FORBIDDEN("Forbidden", 403),
    /**
     * Not Found
     */
    HTTP_NOT_FOUND("Not Found", 404),
    /**
     * Method Not Allowed
     */
    HTTP_BAD_METHOD("Method Not Allowed", 405),
    /**
     * Not Acceptable
     */
    HTTP_NOT_ACCEPTABLE("Not Acceptable", 406),
    /**
     * Proxy Authentication Required
     */
    HTTP_PROXY_AUTH("Proxy Authentication Required", 407),
    /**
     * Request Time-Out
     */
    HTTP_CLIENT_TIMEOUT("Request Time-Out", 408),
    /**
     * Conflict
     */
    HTTP_CONFLICT("Conflict", 409),
    /**
     * Gone
     */
    HTTP_GONE("Gone", 410),
    /**
     * Length Required
     */
    HTTP_LENGTH_REQUIRED("Length Required", 411),
    /**
     * Precondition Failed
     */
    HTTP_PRECON_FAILED("Precondition Failed", 412),
    /**
     * Request Entity Too Large
     */
    HTTP_ENTITY_TOO_LARGE("Request Entity Too Large", 413),
    /**
     * Request-URI Too Large
     */
    HTTP_REQ_TOO_LONG("Request-URI Too Large", 414),
    /**
     * Unsupported Media Type
     */
    HTTP_UNSUPPORTED_TYPE("Unsupported Media Type", 415),
    /**
     * Internal Server Error
     */
    HTTP_INTERNAL_ERROR("Internal Server Error", 500),
    /**
     * Not Implemented
     */
    HTTP_NOT_IMPLEMENTED("Not Implemented", 501),
    /**
     * Bad Gateway
     */
    HTTP_BAD_GATEWAY("Bad Gateway", 502),
    /**
     * Service Unavailable
     */
    HTTP_UNAVAILABLE("Service Unavailable", 503),
    /**
     * Gateway Timeout
     */
    HTTP_GATEWAY_TIMEOUT("Gateway Timeout", 504),
    /**
     * HTTP Version Not Supported
     */
    HTTP_VERSION("HTTP Version Not Supported", 505);

    private final String msg;
    private final Integer code;

    HttpCode(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }

    public Integer getValue() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
